package com.nbsaas.boot.site.rest.resource;

import com.nbsaas.boot.site.api.apis.FeedBackApi;
import com.nbsaas.boot.site.data.entity.FeedBack;
import com.nbsaas.boot.site.api.domain.request.FeedBackRequest;
import com.nbsaas.boot.site.api.domain.response.FeedBackResponse;
import com.nbsaas.boot.site.api.domain.simple.FeedBackSimple;
import com.nbsaas.boot.site.rest.convert.FeedBackSimpleConvert;
import com.nbsaas.boot.site.rest.convert.FeedBackEntityConvert;
import com.nbsaas.boot.site.rest.convert.FeedBackResponseConvert;
import com.nbsaas.boot.site.data.repository.FeedBackRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class FeedBackResource extends BaseResource<FeedBack,FeedBackResponse, FeedBackSimple, FeedBackRequest>  implements FeedBackApi {

    @Resource
    private FeedBackRepository feedBackRepository;

    @Override
    public JpaRepositoryImplementation<FeedBack, Serializable> getJpaRepository() {
        return feedBackRepository;
    }

    @Override
    public Function<FeedBack, FeedBackSimple> getConvertSimple() {
        return new FeedBackSimpleConvert();
    }

    @Override
    public Function<FeedBackRequest, FeedBack> getConvertForm() {
        return new FeedBackEntityConvert();
    }

    @Override
    public Function<FeedBack, FeedBackResponse> getConvertResponse() {
        return new FeedBackResponseConvert();
    }




}


